<template>
  <div>
    <div style="text-align:center">
      <el-upload
        action="http://localhost:8888/CurrencyDiscern/currencyDiscern"
        list-type="picture-card"
        :on-success="successHandler">
        <i class="el-icon-plus"></i>
      </el-upload>
    </div>
    <div>
      <h3>识别结果：</h3>
      {{list}}
      <el-table :data="list">
        <el-table-column label="货币名字" align="center" prop="currencyName"></el-table-column>
        <el-table-column label="年月" align="center" prop="year"></el-table-column>
        <el-table-column label="货币代号" align="center" prop="currencyCode"></el-table-column>
        <el-table-column label="面值" align="center" prop="currencyDenomination"></el-table-column>
      </el-table>
    </div>
  </div>
</template>
<script>
export default {
  data(){
    return {
      resp: {
      },
      list: [],
    }
  },
  methods:{
    successHandler(resp){
      this.resp = resp;
      // console.log(resp)
      // let data = {'A':'A-VALUE', 'B': 'B-Value'};
      this.list.splice(0,0,resp.result);
      // console.log(this.list)

      // this.resp.result = Object.keys(resp.result).map(item => ({key:item, value:resp.result[item]}));
      // console.log(resp.result)
    }
  }
}
</script>
<style lang="sass" scoped>

</style>